

from rest_framework import serializers
from goods.models import SKUImage,SKU


# sku模型类对象序列化器
class SKUSimpleModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = SKU
        fields = [
            'id',
            'name'
        ]


from fdfs_client.client import Fdfs_client
from django.conf import settings
# 图片模型类序列化器
class ImageModelSerializer(serializers.ModelSerializer):

    class Meta:
        model = SKUImage
        fields = [
            'id',
            'sku',
            'image', # drf模型类序列化器针对django的ImageField类型字段，序列化结果为url属性。
        ]







